function equals(view1, view2) {
  if (view1 == null && view2 == null) {
    return true
  }
  if (view1 === undefined && view2 === undefined) {
    return true
  }
  if ((view1 == null && view2 === undefined) || (view1 === undefined && view2 == null)) {
    return true
  }
  return view1.name === view2.name
}

function name(view) {
  const { name } = view || {}
  return name
}

function title(view) {
  const { meta = {}} = view || {}

  const { title } = meta
  return title || 'no-name'
}

export { equals, name, title }
